﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using MINERP.COM;

namespace MINERP.MODEL.DisjoinProForOutShop
{
    public class GridDetailBase
    {
        public bool IsPrint { get; set; }//是否打印（即那个复选框的值）
        /// <summary>
        /// 定单产品信息orderInfo
        /// </summary>
        public OrderInfo_Info OrderProductInfo { get; set; }//

        /// <summary>
        /// 邓估余额是否够
        /// </summary>
        public bool PreCountIsEnough { get; set; }
        /// <summary>
        /// 定单包信息
        /// </summary>
        public Tb_OrderBag_Info OrderBagInfo { get; set; }//
        /// <summary>
        /// 产品信息
        /// </summary>
        public Tb_Product_Info ProductInfo { get; set; }



        //要在页面上显示的数据
        public int OrderBagId { get { return OrderBagInfo.OrderBagId; } }

        public int OrderProductId { get { return OrderProductInfo.OrderProductId; } }

        public string OrderProductCode { get { return OrderProductInfo.OrderProductCode; } }

        public string BagCode { get { return OrderBagInfo.BagCode; } }

        public string BagName { get { return OrderBagInfo.BagName; } }

        public string OrderProductName { get { return OrderProductInfo.OrderProductName; } }

        public string ShopName { get { return OrderBagInfo.ShopName; } }

        public string CtmName { get { return OrderProductInfo.CtmName; } }



        public string CreditLevel { get; set; }
        public string SaleMan { get; set; }
        public int OperateID { set; get; }
       
        public string Size { get { return OrderProductInfo.Height+"×"+OrderProductInfo.Width+"in("+(OrderProductInfo.Height*2.54).ToString("0.00")+"×"+(OrderProductInfo.Width*2.54).ToString("0.00")+"cm)";} }

        public int OrderInfosStatus
        {
            get { return OrderProductInfo.Status; }
        }

        public int photoNum { get; set; }
        public string oiStatus
        {
            get
            {
                switch ((OrderInfoStatus)OrderProductInfo.Status)
                {
                    case OrderInfoStatus.Doing: return "正在生产中";

                    case OrderInfoStatus.Error: return "错误";

                    case OrderInfoStatus.Stop: return "已暂停";

                    case OrderInfoStatus.Completed: return "已完成";
                    case OrderInfoStatus.WaitPay:                   
                    return "余额不足等待付款";
                    case OrderInfoStatus.WaitPayAndWaitMovePhoto:
                    case OrderInfoStatus .WaitPhotoMove:
                    return "正在移动照片";
                    case OrderInfoStatus.Deleted: return "已删除";
                    case OrderInfoStatus.AutoOrderWait: return "远程开单审核"; 
                    default: return "未知，请在客服处查询";
                }
                if (!PreCountIsEnough)
                {
                    return "预计余额不足";
                }
            }
        }
        public bool isShuChu { get; set; }
        public string ProductName { get { return ProductInfo.ProductName; } }
        //委外账单用
        public int Productid
        {
            get { return ProductInfo.ProuctId; }
        }

        public string ProductCode { get { return ProductInfo.ProductCode; } }

        public int ProductNum { get { return OrderProductInfo.ProductNum; } }

        public int Priority { get { return OrderBagInfo.Priority; } }

        public string Remark { get { return OrderProductInfo.Remark; } }

        public DateTime OrderFetchTime { get { return OrderBagInfo.FetchTime; } }
    }
}
